from rest_framework.response import Response

class ProcessResponse:
    @staticmethod
    def success(data=None, status=200, code=200, msg="成功"):
        return Response({'data': data, 'code': code, 'msg': msg}, status=status)

    @staticmethod
    def params_error(msg="参数错误", status=400, code=400):
        return Response({'msg': msg, 'code': code}, status=status)

    @staticmethod
    def fail(msg="失败", status=500, code=500):
        return Response({'msg': msg, 'code': code}, status=status)